/**
 * Copyright 2012 Roger Cockshutt
 * krakenbrau@gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.parallelrl;

import java.util.Date;
import com.googlecode.parallelrl.display.Screen;
import com.googlecode.parallelrl.process.Game;
import com.googlecode.parallelrl.util.MersenneTwister;

/**
 * @author Roger Cockshutt
 *
 */
public class ParallelRL {
	
	public static boolean doDebug = false;
	public static boolean realTime = false;
	

	public static void main(String[] args) {
		
		if (ParallelRL.doDebug)
			System.out.println("Initializing Mersenne Twister...");
		MersenneTwister.initialize((new Date()).getTime());
		
		try {
			if (ParallelRL.doDebug)
				System.out.println("Loading config file...");
			Config.load();
		} catch (IllegalArgumentException | IllegalAccessException exception) {
			// TODO Auto-generated catch block
			exception.printStackTrace();
		}

		if (ParallelRL.doDebug)
			System.out.println("Setting up window...");
		Screen.get().initialize(Config.windowSize.y, Config.windowSize.x, Config.windowTitle);
		
		while (Game.restart) {
			Game.initialize();
			(new Game()).run();
		}
		
		System.exit(0);
	}

}
